<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>CSS Test: An animation specified on an element by modifying the style after the document has loaded will begin when the style is resolved</title>
        <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
        <link rel="help" href="http://www.w3.org/TR/css3-animations/#animation-behavior-" />
        <meta name="flags" content="animated dom" />
        <meta name="assert" content="An animation specified on an element by modifying the style after the document has loaded will begin when the style is resolved." />
        <style type="text/css">
            @keyframes testAnimation
            {
                from {width: 50px;}
                to {width: 200px;} 
            }
            #div0
            {
                animation-duration: 3s;
                animation-fill-mode: forwards;
                background-color: blue;
                height: 50px;
                position: relative;
                width: 50px;
            }
        </style>
        <script type="text/javascript">
            var element;

            window.onload = function()
            {
                    element = document.getElementById("div0");
                    setTimeout("element.style['animation-name'] = 'testAnimation'; element.style['background-color'] = 'orange';", 1000); 
            }
        </script>
    </head>
    <body>
        <p>Test passes if the block starts growing wider as soon as it changes from blue to orange.</p>
        <div id="div0"></div>
    </body>
</html>
